import java.util.ArrayList;
import java.util.List;
import java.util.Map;
import java.util.stream.Collectors;

/**
 * @time: 2021/9/3/003 17:24
 * @author: Zhurunhe
 */
public class CollectGroupBy {

    public static void main(String[] args) {
        Strudent strudent1=new Strudent(1,"test");
        Strudent strudent2=new Strudent(1,"test");
        Strudent strudent3=new Strudent(1,"test");
        Strudent strudent4=new Strudent(1,"tet");
        Strudent strudent5=new Strudent(1,"test");
        List<Strudent> list=new ArrayList<>();
        list.add(strudent1);
        list.add(strudent2);
        list.add(strudent3);
        list.add(strudent4);
        list.add(strudent5);


//        Map<Integer,List<Strudent>> groupMap= list.stream().collect(Collectors.groupingBy(e->e.getId()));
        List<Strudent> groupMap= list.stream().filter(e->e.getId()==0).collect(Collectors.toList());
        if (groupMap.size()!=0){
            System.out.println("多个");
        }else {
            System.out.println("ok");
        }
        for (Strudent l : list) {

        }
    }
}
